package com.beone.admin.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * @title  湖南师大配置
 * @Author 覃球球
 * @Version 1.0 on 2018/11/7.
 * @Copyright 贝旺科技
 */
@Configuration
public class HunnuEduConfig {

    @Value("${spring.profiles.active}")
    private String devMode;

    @Value("${hunnu.oauth2.client_id}")
    private String oauth2ClientId;

    @Value("${hunnu.oauth2.client_secret}")
    private String oauth2ClientSecret;

    @Value("${hunnu.oauth2.server_url}")
    private String oauth2ServerUrl;   // oauth2 server

    @Value("${hunnu.oauth2.redirect_url}")
    private String oauth2RedirectUrl;  //重定向URL

    @Value("${hunnu.api.server_url}")
    private String apiServerUrl; //api server

    @Value("${hunnu.api.key:0vficYSozTfy7X9FbgtYPoQ}")
    private String apiKey;

    @Value("${app.rememberme_key}")
    private String remembermeKey;

    @Value("${app.security.ignorings.permission_url}")
    private String ignoringsPermissionUrl;

    @Value("${app.default_role_id}")
    private String defaultRoleId;

    @Value("${app.default_login_page:/login}")
    private String defaultLoginPage; //默认登录页面

    public String getDefaultLoginPage() {
        return defaultLoginPage;
    }

    public void setDefaultLoginPage(String defaultLoginPage) {
        this.defaultLoginPage = defaultLoginPage;
    }

    public boolean isProdMode(){
        return "prod".equalsIgnoreCase(getDevMode());
    }

    public String getDevMode() {
        return devMode;
    }

    public void setDevMode(String devMode) {
        this.devMode = devMode;
    }

    public String getOauth2ClientId() {
        return oauth2ClientId;
    }

    public void setOauth2ClientId(String oauth2ClientId) {
        this.oauth2ClientId = oauth2ClientId;
    }

    public String getOauth2ClientSecret() {
        return oauth2ClientSecret;
    }

    public void setOauth2ClientSecret(String oauth2ClientSecret) {
        this.oauth2ClientSecret = oauth2ClientSecret;
    }

    public String getOauth2ServerUrl() {
        return oauth2ServerUrl;
    }

    public void setOauth2ServerUrl(String oauth2ServerUrl) {
        this.oauth2ServerUrl = oauth2ServerUrl;
    }

    public String getApiServerUrl() {
        return apiServerUrl;
    }

    public void setApiServerUrl(String apiServerUrl) {
        this.apiServerUrl = apiServerUrl;
    }

    public String getOauth2RedirectUrl() {
        return oauth2RedirectUrl;
    }

    public void setOauth2RedirectUrl(String oauth2RedirectUrl) {
        this.oauth2RedirectUrl = oauth2RedirectUrl;
    }

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getRemembermeKey() {
        return remembermeKey;
    }

    public void setRemembermeKey(String remembermeKey) {
        this.remembermeKey = remembermeKey;
    }

    public String getIgnoringsPermissionUrl() {
        return ignoringsPermissionUrl;
    }

    public void setIgnoringsPermissionUrl(String ignoringsPermissionUrl) {
        this.ignoringsPermissionUrl = ignoringsPermissionUrl;
    }

    public String getDefaultRoleId() {
        return defaultRoleId;
    }

    public void setDefaultRoleId(String defaultRoleId) {
        this.defaultRoleId = defaultRoleId;
    }
}